<%@ page import="com.ama.utils.SpringUtils" %>
<%@ page import="com.ama.service.impl.*" %>
<%@ page import="com.ama.pojo.*" %>
<%@ page import="com.ama.dao.CostDao" %>
<%@ page import="com.ama.utils.NumberUtils" %>
<%@ page import="com.ama.service.*" %>
<%@ page import="com.ama.dao.RepairDao" %>
<%@ page import="com.ama.utils.DateUtil" %>
<%--  Created by IntelliJ IDEA.--%>
<%--  User: zez--%>
<%--  Date: 2020/12/20--%>
<%--  Time: 14:47--%>
<%--  To change this template use File | Settings | File Templates.--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>维修通知</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/materialdesignicons.min.css" rel="stylesheet">
    <link href="../css/style.min.css" rel="stylesheet">
    <style type="text/css">
        input[readonly],
        .form-control[readonly]{
            background-color: #FFFFFF;
        }
    </style>
</head>

<body>
<%
    Long repairId = Long.valueOf(request.getParameter("repairId"));
    RepairDao repairDao = SpringUtils.getBean(RepairDao.class);
    Repair repair = repairDao.selectByPrimaryKey(repairId);

    EstateService estateService = SpringUtils.getBean(EstateServiceImpl.class);
    PropertyService propertyService = SpringUtils.getBean(PropertyServiceImpl.class);


%>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <div class=" text-center m-b-10"><h4>维修信息详情</h4></div>
                    <hr>
                    <form action="#" method="post" class="guide-box" data-navigateable="true">

                        <div class="row m-b-10">
                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">报修地址</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=repair.getRepairAddress()%>">
                                </div>
                            </div>
                        </div>

                        <div class="row m-b-10">
                            <div class="col-lg-6">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">小区名称</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=estateService.selectById(repair.getEstateId()).getEstateName()%>">
                                </div>
                            </div>



                            <div class="col-lg-6">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">物业名称</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=propertyService.selectById(repair.getPropertyId()).getPropertyName()%>">
                                </div>
                            </div>
                        </div>

                        <div class="row m-b-10">
                            <div class="col-lg-6">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">报修类型</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=repair.getRepairType()%>">
                                </div>
                            </div>
                        </div>
                        <div class="row m-b-10">
                        <div class="col-lg-6">
                            <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">报修人</button>
                                    </span>
                                <input type="text" class="form-control bg-white" readonly value="<%=repair.getOwnerName()%>">
                            </div>
                        </div>
                        </div>

                        <div class="row m-b-10">
                            <div class="col-lg-12">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">联系电话</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=repair.getPhoneNumber()%>">
                                </div>
                            </div>
                        </div>

                        <div class="row m-b-10">
                            <div class="col-lg-6">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                      <button class="btn btn-default" type="button">报修日期</button>
                                    </span>
                                    <input type="text" class="form-control bg-white" readonly value="<%=DateUtil.dateToStr(repair.getRepairDate())%>">
                                </div>
                            </div>

                        </div>

                        <div class="row m-b-10">
                            <div class="col-lg-9 ">
                                <div class="form-group">
                                    <span class="input-group-btn">
                                          <button class="btn btn-default" type="button">详细信息</button>
                                    </span>
                                </div>
                            </div>
                            <div class="col-lg-9" style="margin-top: -10px">
                                <textarea class="form-control" rows="6"
                                     readonly    placeholder=""><%=repair.getRepairInfo()%></textarea>
                            </div>
                        </div>


                        <div class="row m-b-10">
                            <div class="col-lg-1">
                                <div class="form-group">
                                    <span class="input-group-btn">
                                          <button class="btn btn-default" type="button">维修状态</button>
                                    </span>
                                </div>
                            </div>
                            <div class="col-lg-1">
                                <%
                                    if(repair.getRepairState()==0){
                                %>
                                <button class="btn btn-warning btn-w-md" >等待维修</button>
                                <%
                                }else if(repair.getRepairState()==1){
                                %>
                                <button class="btn btn-success btn-w-md" >已维修</button>
                                <%
                                }
                                %>
                            </div>


                        </div>


<hr>

                        <div class="nav-step-button">
                            <a class="btn btn-secondary"  data-wizard="prev" type="button" href="mes_service.jsp">返&nbsp;回</a>
                            <a class="btn btn-success" <% if (repair.getRepairState()==1){%>disabled<%}%>
                               href="/repairSuccess?repairId=<%=repairId%>" >维&nbsp;修</a>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>



</div>


<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" src="../js/Chart.js"></script>
<script type="text/javascript"></script>

</body>
</html>